package cn.anecansaitin.industrialization_expansion.common.entity;

import cn.anecansaitin.industrialization_expansion.common.item.ModifiedTool;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.item.ItemEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;

public class ModItemEntity extends ItemEntity {
    private final boolean fireImmune;

    public ModItemEntity(EntityType<? extends ModItemEntity> type, World world) {
        super(type, world);
        fireImmune = false;
    }

    public ModItemEntity(World world, double x, double y, double z) {
        super(world, x, y, z);
        fireImmune = false;
    }

    public ModItemEntity(World world, double x, double y, double z, ItemStack stack) {
        super(world, x, y, z, stack);
        fireImmune = ((ModifiedTool)stack.getItem()).isFireImmune(stack);
    }

    @Override
    public boolean fireImmune() {
        return fireImmune;
    }
}
